package com.example.seckilldemo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author Wangbaba
 * @Date 2024/3/18 16:15
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RespBean {

    private  Integer Code;
    private String Message;
    private Object Obj;

    public static RespBean success(){
        return new RespBean(RespBeanEnum.SUCCESS.getCODE(),RespBeanEnum.SUCCESS.getMESSAGE(), null);
    }

    public static RespBean success(Object obj){
        return new RespBean(RespBeanEnum.SUCCESS.getCODE(),RespBeanEnum.SUCCESS.getMESSAGE(),obj);
    }

    public static RespBean error(RespBeanEnum respBeanEnum){
        return new RespBean(respBeanEnum.getCODE(),respBeanEnum.getMESSAGE(),null);
    }

    public static RespBean error(RespBeanEnum respBeanEnum,Object obj){
        return new RespBean(respBeanEnum.getCODE(),respBeanEnum.getMESSAGE(),obj);
    }
}
